import request from '@/utils-shop/request'

// api地址
const api = {
  data: 'setting/data',
  setBasic: 'setting/setBasic',
  getBasic: 'setting/getBasic',
  setWithdraw: 'setting/setWithdraw',
  getWithdraw: 'setting/getWithdraw',
  setNotice: 'setting/setNotice',
  getNotice: 'setting/getNotice',
  getNoticePlatform: 'setting/getNoticePlatform',
  setImageList: 'setting/setImageList',
  getImageList: 'setting/getImageList',
  setPoints: 'setting/update',
  getPoints: 'setting/detail&key=points'
}

// 设置店铺基础设置
export const setBasic = data => {
  return request.post(api.setBasic, { form:data })
}

// 获取店铺基础设置
export const getBasic = param => {
  return request.get(api.getBasic, param)
}

// 设置提现信息
export const setWithdraw = data => {
  return request.post(api.setWithdraw, { form:data })
}

// 获取提现信息
export const getWithdraw = param => {
  return request.get(api.getWithdraw, param)
}

// 设置提现信息
export const setNotice = data => {
  return request.post(api.setNotice, { form:data })
}

// 获取提现信息
export const getNotice = param => {
  return request.get(api.getNotice, param)
}

// 设置首页广告图
export const setImageList = data => {
  return request.post(api.setImageList, { form:data })
}

// 获取首页广告图
export const getImageList = param => {
  return request.get(api.getImageList, param)
}

// 获取平台提醒
export const getNoticePlatform = param => {
  return request.get(api.getNoticePlatform, param)
}

// 设置积分规则
export const setPoints = (key, data) => {
  return request.post(api.setPoints, { key, form:data })
}

// 获取积分规则
export function getPoints () {
  return request.get(api.getPoints)
}
